import request from '@/config/axios'

export interface OrderVO {
                    typeId: number
                    userId: number
                    itemId: number
                    count: number
                    total: number
                    extendInfo: string
                    status: number
                    id: number
}

// 查询订单列表
export const getOrderPage = async (params) => {
  return await request.get({ url: '/vrs/order/page', params })
}

// 查询订单详情
export const getOrder = async (id: number) => {
  return await request.get({ url: '/vrs/order/get?id=' + id })
}

// 新增订单
export const createOrder = async (data: OrderVO) => {
  return await request.post({ url: '/vrs/order/create', data })
}

// 修改订单
export const updateOrder = async (data: OrderVO) => {
  return await request.put({ url: '/vrs/order/update', data })
}

// 删除订单
export const deleteOrder = async (id: number) => {
  return await request.delete({ url: '/vrs/order/delete?id=' + id })
}

// 导出订单 Excel
export const exportOrderApi = async (params) => {
  return await request.download({ url: '/vrs/order/export-excel', params })
}